package com.cg.service.impl;

import com.cg.dao.ForecastMapper;
import com.cg.dto.ForecastPageDto;
import com.cg.service.ForecastService;
import com.cg.vo.ForecastVo;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * (Forecast)表服务实现类
 *
 * @author chengong
 * @since 2023-12-25 18:40:00
 */
@Service("forecastService")
public class ForecastServiceImpl implements ForecastService {
    @Resource
    private ForecastMapper forecastMapper;


    /**
     * 查询销售预测信息列表
     */
    @Override
    public PageInfo<ForecastVo> list(ForecastPageDto forecastPageDto) {
        PageHelper.startPage(forecastPageDto.getPageNum(),forecastPageDto.getPageSize());
        List<ForecastVo> list = forecastMapper.list(forecastPageDto.getForecastMonth());
        PageInfo<ForecastVo> pageInfo = new PageInfo<>(list);
        return pageInfo;
    }
}
